package com.eims.ball.info.fragment;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.XML;

import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.MySingleton;
import com.android.volley.toolbox.StringXmlRequest;
import com.contans.view.FenxiHistoryVo;
import com.contans.view.FenxiJibenVo;
import com.contans.view.FenxiJifenVo;
import com.contans.view.FenxiTeamFutureVo;
import com.contans.view.FenxiTeamHistoryVo;
import com.contans.view.MainFenxiRowVo;
import com.contans.view.MainFenxiVo;
import com.eims.ball.info.adapter.FanxiJibenGuesFutureListAdapter;
import com.eims.ball.info.adapter.FanxiJibenGuesteamListAdapter;
import com.eims.ball.info.adapter.FanxiJibenHistoryListAdapter;
import com.eims.ball.info.adapter.FanxiJibenJifenListAdapter;
import com.eims.ball.info.adapter.FanxiJibenMainfutureListAdapter;
import com.eims.ball.info.adapter.FanxiJibenMainteamListAdapter;
import com.eims.sls_app.ui.MainFenixActivity;
import com.eims.sls_app.utils.App;
import com.eims.sls_app.utils.AppTools;
import com.eims.sls_app.view.MyListView2;
import com.eims.sls_app.view.MyToast;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.Fragment;
import android.text.Html;
import android.text.Spanned;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import android.widget.Toast;
import android.view.ViewGroup;
import bls.juejin.cn.R;
import progressBar.ProgressDialogBar;

public class FenxiJibenFragment extends Fragment implements OnClickListener {
	private Activity activity;

	private MyListView2 listviewJifen;
	private FanxiJibenJifenListAdapter fenxiJibenJifenAdapter;

	private MyListView2 listviewHistory;
	private FanxiJibenHistoryListAdapter fenxiJibenHistoryAdapter;

	private MyListView2 listviewMainteam;
	private FanxiJibenMainteamListAdapter fenxiJibenMainteamAdapter;

	private MyListView2 listviewGuesteam;
	private FanxiJibenGuesteamListAdapter fenxiJibenGuesTeamAdapter;

	private MyListView2 listviewMainfuture;
	private FanxiJibenMainfutureListAdapter fenxiJibenMainfutureAdapter;

	private MyListView2 listviewGuesfuture;
	private FanxiJibenGuesFutureListAdapter fenxiJibenGuesfutureAdapter;

	private String infoId, hid, gid, mainName, GuesName;

	private MyHandler handler;
	FenxiJibenVo jibenVo;

	private TextView tvHistoryTile, tvMainHistoryTile, tvGuesHistoryTile;



	public FenxiJibenFragment() {
		super();
	}

	public static FenxiJibenFragment newInstance(String infoId, String hid, String gid, String mainName, String GuesName) {



		FenxiJibenFragment fragment = new FenxiJibenFragment();

		Bundle bundle = new Bundle();
		bundle.putString("infoId", infoId);
		bundle.putString("hid", hid);
		bundle.putString("gid", gid);
		bundle.putString("mainName", mainName);
		bundle.putString("GuesName", GuesName);


		fragment.setArguments(bundle);

		return fragment;
	}
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.fenxi_jiben_fragment, container, false);
		activity = getActivity();
		Bundle args = getArguments();
		if (args != null) {
			this.infoId = args.getString("infoId");
			this.hid= args.getString("hid");
			this.gid = args.getString("gid");
			this.mainName= args.getString("mainName");
			this.GuesName= args.getString("GuesName");

		}

		handler = new MyHandler();

		init(view);
		getBalllInfo(infoId);

		return view;
	}

	private void init(View view) {
		// TODO Auto-generated method stub
		listviewJifen = (MyListView2) view.findViewById(R.id.listview_jifen);

		listviewHistory = (MyListView2) view.findViewById(R.id.listview_history);

		listviewMainteam = (MyListView2) view.findViewById(R.id.listview_mian_team);

		listviewGuesteam = (MyListView2) view.findViewById(R.id.listview_gues_team);

		listviewMainfuture = (MyListView2) view.findViewById(R.id.listview_main_future);

		listviewGuesfuture = (MyListView2) view.findViewById(R.id.listview_gues_future);
		tvHistoryTile = (TextView) view.findViewById(R.id.tv_history_title);
		tvMainHistoryTile = (TextView) view.findViewById(R.id.tv_main_history_title);
		tvGuesHistoryTile = (TextView) view.findViewById(R.id.tv_gues_history_title);

	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		// case R.id.btn_pay_money:
		//
		// break;

		default:
			break;
		}
	}

	public String JSONTokener(String in) {
		// consume an optional byte order mark (BOM) if it exists
		if (in != null && in.startsWith("\ufeff")) {
			in = in.substring(1);
		}
		return in;
	}

	public void getBalllInfo(String id) {
		MySingleton mySingleton = MySingleton.getInstance(activity);
		ProgressDialogBar.startProgress(activity, "", true);
		StringXmlRequest jsonObjectRequest = new StringXmlRequest(Request.Method.GET,
				"http://01link.igowu123.com/qtjsbf/jc/zjdata/" + id + ".xml", new Response.Listener<String>() {
					@Override
					public void onResponse(String tn) {

						Log.i("RealTime", "request--------success------" + tn);

						try {
							JSONObject obj = XML.toJSONObject(tn);

							JSONObject item = new JSONObject(JSONTokener(obj.toString()));
							Log.e("JSON", item.toString());

							jibenVo = new FenxiJibenVo();

							String resultRep = item.optString("rows");

							item = new JSONObject(resultRep);

							jibenVo.setHidAndName(item.optString("hidAndName"));
							jibenVo.setGidAndName(item.optString("gidAndName"));
							jibenVo.setLn(item.optString("ln"));
							jibenVo.setLid(item.optString("lid"));
							jibenVo.setRid(item.optString("rid"));

							jibenVo.setH5_lid(item.optString("h5_lid"));
							jibenVo.setItemId(item.optString("itemId"));
							jibenVo.setSort(item.optString("sort"));
							jibenVo.setMainName(hid);
							jibenVo.setGuesName(gid);

							String CreditinfoStr = item.optString("Creditinfo");

							if (CreditinfoStr != null && !"".equals(CreditinfoStr)) {
								
							
								JSONArray array_jifen = new JSONArray(CreditinfoStr);

								ArrayList<FenxiJifenVo> jifenVos = new ArrayList<FenxiJifenVo>();
								FenxiJifenVo jifenVo;

								for (int i = 0; i < array_jifen.length(); i++) {
									jifenVo = new FenxiJifenVo();

									JSONObject array2 = array_jifen.getJSONObject(i);
									jifenVo.setTeamname(array2.optString("teamname"));
									jifenVo.setTeamId(array2.optString("teamId"));
									jifenVo.setRank(array2.optString("rank"));
									jifenVo.setPoints(array2.optString("points"));
									jifenVo.setAll(array2.optString("all"));
									jifenVo.setHost(array2.optString("host"));
									jifenVo.setGuest(array2.optString("guest"));
									jifenVo.setHasdetailrank(array2.optString("setHasdetailrank"));
									jifenVos.add(jifenVo);

								}
								jibenVo.setJifenVo(jifenVos);

							}

							String vsrowStr = item.optString("vsrow");

							if (vsrowStr != null && !"".equals(vsrowStr)) {

								ArrayList<FenxiHistoryVo> historyVos = new ArrayList<FenxiHistoryVo>();
								FenxiHistoryVo historyVo;
								int historyWin = 0;
								int historySpf = 0;
								int historyGus = 0;
								if (vsrowStr.contains("[")) {
									JSONArray array_history = new JSONArray(vsrowStr);
									for (int i = 0; i < array_history.length(); i++) {
										historyVo = new FenxiHistoryVo();

										JSONObject array3 = array_history.getJSONObject(i);
										String hm7Hid = array3.optString("m7Hid");
										String hhsc = array3.optString("hsc");
										String hasc = array3.optString("asc");

										if (hm7Hid.equals(hid)) {
											if (Integer.parseInt(hhsc) > Integer.parseInt(hasc)) {
												historyWin = historyWin + 1;
												historyVo.setResult("胜");

											} else if (Integer.parseInt(hhsc) < Integer.parseInt(hasc)) {
												historyGus = historyGus + 1;
												historyVo.setResult("负");
											} else {
												historyVo.setResult("平");
												historySpf = historySpf + 1;
											}

										} else {

											if (Integer.parseInt(hhsc) > Integer.parseInt(hasc)) {
												historyGus = historyGus + 1;
												historyVo.setResult("负");

											} else if (Integer.parseInt(hhsc) < Integer.parseInt(hasc)) {
												historyWin = historyWin + 1;
												historyVo.setResult("胜");
											} else {
												historyVo.setResult("平");
												historySpf = historySpf + 1;
											}

										}

										historyVo.setLn(array3.optString("ln"));
										historyVo.setTime(array3.optString("time"));
										historyVo.setHn(array3.optString("hn"));
										historyVo.setGn(array3.optString("gn"));
										historyVo.setM7Hid(hm7Hid);
										historyVo.setM7Aid(array3.optString("m7Aid"));
										historyVo.setHsc(hhsc);
										historyVo.setAsc(hasc);
										historyVo.setMatchId(array3.optString("matchId"));
										historyVos.add(historyVo);

									}
								} else {
									historyVo = new FenxiHistoryVo();

									JSONObject array3 = new JSONObject(vsrowStr);
									String hm7Hid = array3.optString("m7Hid");
									String hhsc = array3.optString("hsc");
									String hasc = array3.optString("asc");

									if (hm7Hid.equals(hid)) {
										if (Integer.parseInt(hhsc) > Integer.parseInt(hasc)) {
											historyWin = historyWin + 1;
											historyVo.setResult("胜");

										} else if (Integer.parseInt(hhsc) < Integer.parseInt(hasc)) {
											historyGus = historyGus + 1;
											historyVo.setResult("负");
										} else {
											historyVo.setResult("平");
											historySpf = historySpf + 1;
										}

									} else {

										if (Integer.parseInt(hhsc) > Integer.parseInt(hasc)) {
											historyGus = historyGus + 1;
											historyVo.setResult("负");

										} else if (Integer.parseInt(hhsc) < Integer.parseInt(hasc)) {
											historyWin = historyWin + 1;
											historyVo.setResult("胜");
										} else {
											historyVo.setResult("平");
											historySpf = historySpf + 1;
										}

									}

									historyVo.setLn(array3.optString("ln"));
									historyVo.setTime(array3.optString("time"));
									historyVo.setHn(array3.optString("hn"));
									historyVo.setGn(array3.optString("gn"));
									historyVo.setM7Hid(hm7Hid);
									historyVo.setM7Aid(array3.optString("m7Aid"));
									historyVo.setHsc(hhsc);
									historyVo.setAsc(hasc);
									historyVo.setMatchId(array3.optString("matchId"));
									historyVos.add(historyVo);
								}

								jibenVo.setHisWinnim(historyWin);
								jibenVo.setHisGuesWin(historyGus);
								jibenVo.setHisSpf(historySpf);

								jibenVo.setHistoryVo(historyVos);
							}

							String rowStr = item.getString("row");

							if (rowStr != null && !"".equals(rowStr)) {

								JSONArray team_main_history = new JSONArray(rowStr);
								ArrayList<FenxiTeamHistoryVo> mainteamHistoryVos = new ArrayList<FenxiTeamHistoryVo>();
								FenxiTeamHistoryVo mainteamHistoryVo;
								int mainhistoryWin = 0;
								int mainhistorySpf = 0;
								int mianhistoryGus = 0;

								ArrayList<FenxiTeamHistoryVo> guesteamHistoryVos = new ArrayList<FenxiTeamHistoryVo>();
								FenxiTeamHistoryVo guesteamHistoryVo;
								int gueshistoryWin = 0;
								int gueshistorySpf = 0;
								int gueshistoryGus = 0;

								for (int i = 0; i < team_main_history.length(); i++) {

									JSONObject array4 = team_main_history.getJSONObject(i);
									String teamTeId = array4.optString("teamId");

									if (hid.equals(teamTeId)) {
										if (mainteamHistoryVos.size() < 10) {
											mainteamHistoryVo = new FenxiTeamHistoryVo();

											String teamHId = array4.optString("teamHId");
											String hhsc = array4.optString("hsc");
											String hasc = array4.optString("asc");

											if (teamHId.equals(hid)) {

												if (Integer.parseInt(hhsc) > Integer.parseInt(hasc)) {
													mainhistoryWin = mainhistoryWin + 1;
													mainteamHistoryVo.setResult("胜");

												} else if (Integer.parseInt(hhsc) < Integer.parseInt(hasc)) {
													mianhistoryGus = mianhistoryGus + 1;
													mainteamHistoryVo.setResult("负");
												} else {
													mainteamHistoryVo.setResult("平");
													mainhistorySpf = mainhistorySpf + 1;
												}

											} else {

												if (Integer.parseInt(hhsc) > Integer.parseInt(hasc)) {
													mianhistoryGus = mianhistoryGus + 1;
													mainteamHistoryVo.setResult("负");

												} else if (Integer.parseInt(hhsc) < Integer.parseInt(hasc)) {
													mainhistoryWin = mainhistoryWin + 1;
													mainteamHistoryVo.setResult("胜");
												} else {
													mainteamHistoryVo.setResult("平");
													mainhistorySpf = mainhistorySpf + 1;
												}

											}

											mainteamHistoryVo.setLn(array4.optString("ln"));
											mainteamHistoryVo.setTime(array4.optString("time"));
											mainteamHistoryVo.setHn(array4.optString("hn"));
											mainteamHistoryVo.setGn(array4.optString("gn"));

											mainteamHistoryVo.setHsc(hhsc);
											mainteamHistoryVo.setAsc(hasc);
											mainteamHistoryVo.setTeamId(teamTeId);

											mainteamHistoryVo.setTeamHId(teamHId);
											mainteamHistoryVo.setTeamAId(array4.optString("teamAId"));

											mainteamHistoryVo.setMatchId(array4.optString("matchId"));
											mainteamHistoryVos.add(mainteamHistoryVo);
										}
									} else {
										if (guesteamHistoryVos.size() < 10) {

											guesteamHistoryVo = new FenxiTeamHistoryVo();

											String guesteamHId = array4.optString("teamHId");
											String gueshhsc = array4.optString("hsc");
											String gueshasc = array4.optString("asc");

											if (guesteamHId.equals(gid)) {
												if (Integer.parseInt(gueshhsc) > Integer.parseInt(gueshasc)) {
													gueshistoryWin = gueshistoryWin + 1;
													guesteamHistoryVo.setResult("胜");

												} else if (Integer.parseInt(gueshhsc) < Integer.parseInt(gueshasc)) {
													gueshistoryGus = gueshistoryGus + 1;
													guesteamHistoryVo.setResult("负");
												} else {
													guesteamHistoryVo.setResult("平");
													gueshistorySpf = gueshistorySpf + 1;
												}

											} else {

												if (Integer.parseInt(gueshhsc) > Integer.parseInt(gueshasc)) {
													gueshistoryGus = gueshistoryGus + 1;
													guesteamHistoryVo.setResult("负");

												} else if (Integer.parseInt(gueshhsc) < Integer.parseInt(gueshasc)) {
													gueshistoryWin = gueshistoryWin + 1;
													guesteamHistoryVo.setResult("胜");
												} else {
													guesteamHistoryVo.setResult("平");
													gueshistorySpf = gueshistorySpf + 1;
												}

											}

											guesteamHistoryVo.setLn(array4.optString("ln"));
											guesteamHistoryVo.setTime(array4.optString("time"));
											guesteamHistoryVo.setHn(array4.optString("hn"));
											guesteamHistoryVo.setGn(array4.optString("gn"));

											guesteamHistoryVo.setHsc(gueshhsc);
											guesteamHistoryVo.setAsc(gueshasc);
											guesteamHistoryVo.setTeamId(teamTeId);

											guesteamHistoryVo.setTeamHId(guesteamHId);
											guesteamHistoryVo.setTeamAId(array4.optString("teamAId"));

											guesteamHistoryVo.setMatchId(array4.optString("matchId"));
											guesteamHistoryVos.add(guesteamHistoryVo);

										}

									}

								}

								jibenVo.setMainTeamWinnim(mainhistoryWin);
								jibenVo.setMainTeamSpf(mainhistorySpf);
								jibenVo.setMainTeamGuesWin(mianhistoryGus);

								jibenVo.setMainHistoryVo(mainteamHistoryVos);

								jibenVo.setGuesTeamWinnim(gueshistoryWin);
								jibenVo.setGuesTeamSpf(gueshistorySpf);
								jibenVo.setGuesTeamGuesWin(gueshistoryGus);

								jibenVo.setGuesHistoryVo(guesteamHistoryVos);

							}

							String CommingStr = item.optString("Comming");

							ArrayList<FenxiTeamFutureVo> MainteamFutureVos = new ArrayList<FenxiTeamFutureVo>();

							FenxiTeamFutureVo MainfutureVo;

							ArrayList<FenxiTeamFutureVo> GuesteamFutureVos = new ArrayList<FenxiTeamFutureVo>();

							FenxiTeamFutureVo GuesfutureVo;

							if (CommingStr != null && !"".equals(CommingStr)) {
								
								
								if (CommingStr.contains("[")) {
									JSONArray team_main_future = new JSONArray(CommingStr);

									for (int i = 0; i < team_main_future.length(); i++) {

										JSONObject array5 = team_main_future.getJSONObject(i);

										String teamTeId = array5.optString("teamId");

										if (teamTeId.equals(hid)) {

											if (MainteamFutureVos.size() < 3) {

												MainfutureVo = new FenxiTeamFutureVo();
												MainfutureVo.setMatch(array5.optString("match"));
												MainfutureVo.setTime(array5.optString("time"));
												MainfutureVo.setTeamId(teamTeId);
												MainfutureVo.setHost(array5.optString("host"));
												MainfutureVo.setGuest(array5.optString("guest"));
												MainfutureVo.setTeamHId(array5.optString("teamHId"));
												MainfutureVo.setTeamAId(array5.optString("teamAId"));
												MainfutureVo.setLater(array5.optString("later"));
												MainteamFutureVos.add(MainfutureVo);

											}

										} else {

											if (GuesteamFutureVos.size() < 3) {

												GuesfutureVo = new FenxiTeamFutureVo();
												GuesfutureVo.setMatch(array5.optString("match"));
												GuesfutureVo.setTime(array5.optString("time"));
												GuesfutureVo.setTeamId(teamTeId);
												GuesfutureVo.setHost(array5.optString("host"));
												GuesfutureVo.setGuest(array5.optString("guest"));
												GuesfutureVo.setTeamHId(array5.optString("teamHId"));
												GuesfutureVo.setTeamAId(array5.optString("teamAId"));
												GuesfutureVo.setLater(array5.optString("later"));
												GuesteamFutureVos.add(GuesfutureVo);

											}

										}

									}

									
								}else {
									JSONObject array5 = new JSONObject(CommingStr);

									String teamTeId = array5.optString("teamId");

									if (teamTeId.equals(hid)) {

										if (MainteamFutureVos.size() < 3) {

											MainfutureVo = new FenxiTeamFutureVo();
											MainfutureVo.setMatch(array5.optString("match"));
											MainfutureVo.setTime(array5.optString("time"));
											MainfutureVo.setTeamId(teamTeId);
											MainfutureVo.setHost(array5.optString("host"));
											MainfutureVo.setGuest(array5.optString("guest"));
											MainfutureVo.setTeamHId(array5.optString("teamHId"));
											MainfutureVo.setTeamAId(array5.optString("teamAId"));
											MainfutureVo.setLater(array5.optString("later"));
											MainteamFutureVos.add(MainfutureVo);

										}

									} else {

										if (GuesteamFutureVos.size() < 3) {

											GuesfutureVo = new FenxiTeamFutureVo();
											GuesfutureVo.setMatch(array5.optString("match"));
											GuesfutureVo.setTime(array5.optString("time"));
											GuesfutureVo.setTeamId(teamTeId);
											GuesfutureVo.setHost(array5.optString("host"));
											GuesfutureVo.setGuest(array5.optString("guest"));
											GuesfutureVo.setTeamHId(array5.optString("teamHId"));
											GuesfutureVo.setTeamAId(array5.optString("teamAId"));
											GuesfutureVo.setLater(array5.optString("later"));
											GuesteamFutureVos.add(GuesfutureVo);

										}

									}
								}
								jibenVo.setMainFutureVo(MainteamFutureVos);
								jibenVo.setGuesFutureVo(GuesteamFutureVos);
								

							}

							ProgressDialogBar.stopProgress();
							handler.sendEmptyMessage(1);

							//
						} catch (JSONException e) {
							Log.e("JSON", "xml->json失败" + e.getLocalizedMessage());
							// MyToast.getToast(activity, "获取失败").show();

						}
						ProgressDialogBar.stopProgress();
					}
				}, new Response.ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.i("RealTime", "request--------success------" + error);
						MyToast.getToast(activity, "获取失败").show();
						ProgressDialogBar.stopProgress();
					}

				}) {

			@Override
			protected Map<String, String> getParams() throws AuthFailureError {

				Map<String, String> params = new HashMap<String, String>();
				// params.put("appid", "0af5281058488ec1784e433f69d45d81");
				// params.put("custNo", "gl00014156");
				// params.put("orderId", attach);

				return params;
			}
		};

		jsonObjectRequest.setShouldCache(false);// 是否设置缓存

		mySingleton.addToRequestQueue(jsonObjectRequest);

	}

	@SuppressLint("HandlerLeak")
	class MyHandler extends Handler {
		@Override
		public void handleMessage(Message msg) {

			switch (msg.what) {
			case 0:

				break;
			case 1:

				if (jibenVo.getHistoryVo() != null) {
					Spanned tv1 = Html.fromHtml(
							AppTools.changeStringColor("#000000", "近" + jibenVo.getHistoryVo().size() + "场，" + mainName)
									+ AppTools.changeStringColor("#D44B5E", jibenVo.getHisWinnim() + "胜")
									+ AppTools.changeStringColor("#268DD2", jibenVo.getHisSpf() + "平")
									+ AppTools.changeStringColor("#7EA647", jibenVo.getHisGuesWin() + "负"));
					tvHistoryTile.setText(tv1);

				}

				if (jibenVo.getMainHistoryVo() != null) {
					Spanned tv2 = Html.fromHtml(AppTools.changeStringColor("#000000",
							"近" + jibenVo.getMainHistoryVo().size() + "场，" + mainName)
							+ AppTools.changeStringColor("#D44B5E", jibenVo.getMainTeamWinnim() + "胜")
							+ AppTools.changeStringColor("#268DD2", jibenVo.getMainTeamSpf() + "平")
							+ AppTools.changeStringColor("#7EA647", jibenVo.getMainTeamGuesWin() + "负"));
					tvMainHistoryTile.setText(tv2);

				}
				if (jibenVo.getGuesHistoryVo() != null) {
					Spanned tv3 = Html.fromHtml(AppTools.changeStringColor("#000000",
							"近" + jibenVo.getGuesHistoryVo().size() + "场，" + GuesName)
							+ AppTools.changeStringColor("#D44B5E", jibenVo.getGuesTeamWinnim() + "胜")
							+ AppTools.changeStringColor("#268DD2", jibenVo.getGuesTeamSpf() + "平")
							+ AppTools.changeStringColor("#7EA647", jibenVo.getGuesTeamGuesWin() + "负"));
					tvGuesHistoryTile.setText(tv3);

				}
				fenxiJibenJifenAdapter = new FanxiJibenJifenListAdapter(activity, jibenVo);
				listviewJifen.setAdapter(fenxiJibenJifenAdapter);

				fenxiJibenHistoryAdapter = new FanxiJibenHistoryListAdapter(activity, jibenVo);
				listviewHistory.setAdapter(fenxiJibenHistoryAdapter);

				fenxiJibenMainteamAdapter = new FanxiJibenMainteamListAdapter(activity, jibenVo);
				listviewMainteam.setAdapter(fenxiJibenMainteamAdapter);

				fenxiJibenGuesTeamAdapter = new FanxiJibenGuesteamListAdapter(activity, jibenVo);
				listviewGuesteam.setAdapter(fenxiJibenGuesTeamAdapter);

				fenxiJibenMainfutureAdapter = new FanxiJibenMainfutureListAdapter(activity, jibenVo);
				listviewMainfuture.setAdapter(fenxiJibenMainfutureAdapter);

				fenxiJibenGuesfutureAdapter = new FanxiJibenGuesFutureListAdapter(activity, jibenVo);
				listviewGuesfuture.setAdapter(fenxiJibenGuesfutureAdapter);
				break;
			default:
				Toast.makeText(getActivity(), "网络异常，加载失败。", Toast.LENGTH_SHORT).show();
				break;
			}
			super.handleMessage(msg);
		}
	}

}
